package com.empire.module.sporttery.dal.mysql.footballmatch;

import java.util.*;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
import com.empire.framework.common.pojo.PageResult;
import com.empire.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.empire.framework.mybatis.core.mapper.BaseMapperX;
import com.empire.module.sporttery.controller.app.football.vo.AppFootballMatchPageReqVO;
import com.empire.module.sporttery.dal.dataobject.footballmatch.FootballMatchDO;
import org.apache.ibatis.annotations.Mapper;
import com.empire.module.sporttery.controller.admin.footballmatch.vo.*;

/**
 * 竞猜足彩比赛 Mapper
 *
 * @author 无敌仙人
 */
@Mapper
public interface FootballMatchMapper extends BaseMapperX<FootballMatchDO> {

    default PageResult<FootballMatchDO> selectPage(FootballMatchPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FootballMatchDO>()
                .eqIfPresent(FootballMatchDO::getNumber, reqVO.getNumber())
                .eqIfPresent(FootballMatchDO::getMatchId, reqVO.getMatchId())
                .eqIfPresent(FootballMatchDO::getMatch, reqVO.getMatch())
                .eqIfPresent(FootballMatchDO::getMatchUrl, reqVO.getMatchUrl())
                .eqIfPresent(FootballMatchDO::getAnalysis, reqVO.getAnalysis())
                .eqIfPresent(FootballMatchDO::getColor, reqVO.getColor())
                .betweenIfPresent(FootballMatchDO::getOpenTime, reqVO.getOpenTime())
                .eqIfPresent(FootballMatchDO::getGoalOdds, reqVO.getGoalOdds())
                .eqIfPresent(FootballMatchDO::getLetOdds, reqVO.getLetOdds())
                .eqIfPresent(FootballMatchDO::getHalfWholeOdds, reqVO.getHalfWholeOdds())
                .eqIfPresent(FootballMatchDO::getNotLetOdds, reqVO.getNotLetOdds())
                .eqIfPresent(FootballMatchDO::getScoreOdds, reqVO.getScoreOdds())
                .eqIfPresent(FootballMatchDO::getLetBall, reqVO.getLetBall())
                .eqIfPresent(FootballMatchDO::getHomeTeam, reqVO.getHomeTeam())
                .eqIfPresent(FootballMatchDO::getState, reqVO.getState())
                .eqIfPresent(FootballMatchDO::getVisitingTeam, reqVO.getVisitingTeam())
                .eqIfPresent(FootballMatchDO::getIsSingle, reqVO.getIsSingle())
                .eqIfPresent(FootballMatchDO::getDeadline, reqVO.getDeadline())
                .eqIfPresent(FootballMatchDO::getHalfFullCourt, reqVO.getHalfFullCourt())
                .eqIfPresent(FootballMatchDO::getAward, reqVO.getAward())
                .betweenIfPresent(FootballMatchDO::getStartTime, reqVO.getStartTime())
//                .betweenIfPresent(FootballMatchDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(FootballMatchDO::getScore, reqVO.getScore())
                .eqIfPresent(FootballMatchDO::getHomeTeamUrl, reqVO.getHomeTeamUrl())
                .eqIfPresent(FootballMatchDO::getVisitTeamUrl, reqVO.getVisitTeamUrl())
                .eqIfPresent(FootballMatchDO::getWinPay, reqVO.getWinPay())
                .eqIfPresent(FootballMatchDO::getDrawPay, reqVO.getDrawPay())
                .eqIfPresent(FootballMatchDO::getVisitPay, reqVO.getVisitPay())
                .eqIfPresent(FootballMatchDO::getLetWinPay, reqVO.getLetWinPay())
                .eqIfPresent(FootballMatchDO::getLetDrawPay, reqVO.getLetDrawPay())
                .eqIfPresent(FootballMatchDO::getLetVisitPay, reqVO.getLetVisitPay())
                .eqIfPresent(FootballMatchDO::getWinRate, reqVO.getWinRate())
                .eqIfPresent(FootballMatchDO::getDrawWinRate, reqVO.getDrawWinRate())
                .eqIfPresent(FootballMatchDO::getVisitWinRate, reqVO.getVisitWinRate())
                .eqIfPresent(FootballMatchDO::getLetWinRate, reqVO.getLetWinRate())
                .eqIfPresent(FootballMatchDO::getLetDrawWinRate, reqVO.getLetDrawWinRate())
                .eqIfPresent(FootballMatchDO::getLetVisitWinRate, reqVO.getLetVisitWinRate())
                .eqIfPresent(FootballMatchDO::getWinFlag, reqVO.getWinFlag())
                .eqIfPresent(FootballMatchDO::getDrawWinFlag, reqVO.getDrawWinFlag())
                .eqIfPresent(FootballMatchDO::getVisitWinFlag, reqVO.getVisitWinFlag())
                .eqIfPresent(FootballMatchDO::getLetWinFlag, reqVO.getLetWinFlag())
                .eqIfPresent(FootballMatchDO::getLetDrawWinFlag, reqVO.getLetDrawWinFlag())
                .eqIfPresent(FootballMatchDO::getLetVisitWinFlag, reqVO.getLetVisitWinFlag())
                .eqIfPresent(FootballMatchDO::getWinSelect, reqVO.getWinSelect())
                .eqIfPresent(FootballMatchDO::getDrawWinSelect, reqVO.getDrawWinSelect())
                .eqIfPresent(FootballMatchDO::getVisitWinSelect, reqVO.getVisitWinSelect())
                .eqIfPresent(FootballMatchDO::getLetWinSelect, reqVO.getLetWinSelect())
                .eqIfPresent(FootballMatchDO::getLetDrawWinSelect, reqVO.getLetDrawWinSelect())
                .eqIfPresent(FootballMatchDO::getLetVisitWinSelect, reqVO.getLetVisitWinSelect())
                .eqIfPresent(FootballMatchDO::getTrendWin, reqVO.getTrendWin())
                .eqIfPresent(FootballMatchDO::getOuDiff, reqVO.getOuDiff())
                .eqIfPresent(FootballMatchDO::getHotTeam, reqVO.getHotTeam())
                .eqIfPresent(FootballMatchDO::getZw, reqVO.getZw())
                .eqIfPresent(FootballMatchDO::getMountDesc, reqVO.getMountDesc())
                .eqIfPresent(FootballMatchDO::getMount, reqVO.getMount())
                .eqIfPresent(FootballMatchDO::getSelectSort, reqVO.getSelectSort())
                .eqIfPresent(FootballMatchDO::getScoreSelect, reqVO.getScoreSelect())
                .eqIfPresent(FootballMatchDO::getTeamScore, reqVO.getTeamScore())
                .eqIfPresent(FootballMatchDO::getIsView, reqVO.getIsView())
                .eqIfPresent(FootballMatchDO::getBallNumPredict, reqVO.getBallNumPredict())
                .eqIfPresent(FootballMatchDO::getBallNum, reqVO.getBallNum())
                .eqIfPresent(FootballMatchDO::getOuHomeRate, reqVO.getOuHomeRate())
                .eqIfPresent(FootballMatchDO::getOuDrawRate, reqVO.getOuDrawRate())
                .eqIfPresent(FootballMatchDO::getOuVisitRate, reqVO.getOuVisitRate())
                .eqIfPresent(FootballMatchDO::getOuResult, reqVO.getOuResult())
                .eqIfPresent(FootballMatchDO::getHomeAlgScoreBan, reqVO.getHomeAlgScoreBan())
                .eqIfPresent(FootballMatchDO::getAwayAlgScoreBan, reqVO.getAwayAlgScoreBan())
                .eqIfPresent(FootballMatchDO::getHomeAlgScoreQuan, reqVO.getHomeAlgScoreQuan())
                .eqIfPresent(FootballMatchDO::getAwayAlgScoreQuan, reqVO.getAwayAlgScoreQuan())
                .eqIfPresent(FootballMatchDO::getHomePreScoreBan, reqVO.getHomePreScoreBan())
                .eqIfPresent(FootballMatchDO::getAwayPreScoreBan, reqVO.getAwayPreScoreBan())
                .eqIfPresent(FootballMatchDO::getHomePreScoreQuan, reqVO.getHomePreScoreQuan())
                .eqIfPresent(FootballMatchDO::getAwayPreScoreQuan, reqVO.getAwayPreScoreQuan())
                .eqIfPresent(FootballMatchDO::getRemark, reqVO.getRemark())
                .orderByDesc(FootballMatchDO::getId));
    }

    default List<FootballMatchDO> selectLike(AppFootballMatchPageReqVO reqVO){
        return selectList(new LambdaQueryWrapperX<FootballMatchDO>());
//                .likeIfPresent(FootballMatchDO::getStartTime, reqVO.getStartTime())
//                .likeIfPresent(FootballMatchDO::getRemark, reqVO.getRemark()));
    }

}